import request from '@/config/axios'

export interface RequirementManageBuyFormVO {
  id: number
  productNumber: string
  productName: string
  drawingNumber: string
  requisitionForm: string
  dictDataSource: string
  approver: string
  approverName: string
  approverTime: Date
  productStandard: string
  dictRequisitionFormStatus: number
  details: []
}

// 查询订单管理-需求管理-申购单列表
export const getRequirementManageBuyFormPage = async (params) => {
  return await request.get({ url: `/order/requirement-manage-buy-form/page`, params })
}

// 查询订单管理-需求管理-申购单详情
export const getRequirementManageBuyForm = async (id: number) => {
  return await request.get({ url: `/order/requirement-manage-buy-form/get?id=` + id })
}

// 保存订单管理-需求管理-申购单
export const updateRequirementManageBuyForm = async (data: RequirementManageBuyFormVO) => {
  return await request.put({ url: `/order/requirement-manage-buy-form/update`, data })
}

// 审批订单管理-需求管理-申购单
export const approveRequirementManageBuyForm = async (data: number[]) => {
  return await request.put({ url: `/order/requirement-manage-buy-form/commit`, data })
}

// 导出订单管理-需求管理-申购单 Excel
export const exportRequirementManageBuyForm = async (data) => {
  return await request.download({ url: `/order/requirement-manage-buy-form/export-excel`, data })
}
